<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <title>TODO supply a title</title>
    </head>
    <body>
        <div>lista livro
            <h:form>
                <h:dataTable value="#{livroFaces.livros}" var="item">
                    <h:column>
                        <f:facet name="header"> Nome do Livro</f:facet>
                        #{item.nome}
                    </h:column>
                    <h:column>
                        <f:facet name="header"> Nome do Autor</f:facet>
                        #{item.autor.nome}
                    </h:column>
                    <h:column>
                        <f:facet name="header"> Editar </f:facet>
                        <h:commandLink value="Editar" action="#{livroFaces.edit(item)}"/> 
                    </h:column>
                </h:dataTable>
                <h:commandLink id="lnkNovoLivro" value="Cadastro de Livro" action="#{livroFaces.adicionar}"/> 
            </h:form>
        </div>
    </body>
</html>
